<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" integrity="sha256-iM4Yzi/zLj/IshPWMC1IluRxTtRjMqjPGd97TZ9yYpU=" crossorigin="anonymous"></script>
  <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
  <link rel="shortcut icon" type="image/png" href="/favicon.png">

  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
  <link rel="stylesheet" href="/css/css/work-sans-v7.css">
  <script src="/js/main.js"></script>

  <!-- Begin Jekyll SEO tag v2.6.1 -->
<title>PY: Get Post Comments | Hive Developer</title>
<meta name="generator" content="Jekyll v4.0.0" />
<meta property="og:title" content="PY: Get Post Comments" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Fetch comments made on each content or post using Python." />
<meta property="og:description" content="Fetch comments made on each content or post using Python." />
<link rel="canonical" href="get_post_comments.html" />
<meta property="og:url" content="get_post_comments.html" />
<meta property="og:site_name" content="Hive Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-08-26T11:52:22-07:00" />
<script type="application/ld+json">
{"description":"Fetch comments made on each content or post using Python.","mainEntityOfPage":{"@type":"WebPage","@id":"get_post_comments.html"},"@type":"BlogPosting","url":"get_post_comments.html","headline":"PY: Get Post Comments","dateModified":"2020-08-26T11:52:22-07:00","datePublished":"2020-08-26T11:52:22-07:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->


  
</head>
<body>
<header>
  <h1>
    <button type="button" class="open-nav" id="open-nav"></button>
    <a href="/"  class="logo-link"><img src="/images/logotype_black.svg" height="40" alt="Hive Developer logo"></a>
  </h1>

  
  <form action="/search/" method="get">
    <input type="text" name="q" id="search-input" placeholder="Search">
    <input type="submit" value="Search" style="display: none;">
  </form>
  

  <div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Hive</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-hive-full-nodes">Hive Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Hive Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-hive-blog">hive.blog</a></li>
						
					
						
						<li><a href="/services/#services-hivesigner">HiveSigner</a></li>
						
					
						
						<li><a href="/services/#services-jussi">Jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-dhf">DHF</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-bridge">Bridge</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-debug-node-api">Debug Node Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rc-api">Rc Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-reputation-api">Reputation Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rewards-api">Rewards Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-transaction-status-api">Transaction Status Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-communities">Broadcast Ops Communities</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/resources/">
		<h6 class="ctrl-nav-section title">Resources</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/resources/#resources-overview">Overview</a></li>
						
					
						
						<li><a href="/resources/#resources-client-libs">Client Libraries</a></li>
						
					
						
						<li><a href="/resources/#resources-bluepaper">Bluepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-whitepaper">Whitepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-tools">Tools</a></li>
						
					
						
						<li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
						
					
						
						<li><a href="/resources/#resources-hive-keychain">Hive Keychain</a></li>
						
					
						
						<li><a href="/resources/#resources-developeradvocate">Community & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>



  <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
  <div class="hero">
    <h1 class="hero__h1">Hive Developer Portal </h1>
    <img class="hero__img" src="/images/honey-comb-92.png" style="position: relative; top: 10px;" />
  </div>
  <section id="tutorials-python-get-post-comments" class="row tutorials-python-get-post-comments">
	<h3>
		<a id="tutorials-python-get-post-comments">
			PY: Get Post Comments
			
		</a>
	</h3>
	
		<span class="description"><p>Fetch comments made on each content or post using Python.</p>
</span>
	

	<p><span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of <a href="https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/python/tutorials/07_get_post_comments">Get Post Comments</a> can be downloaded as part of: <a href="https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/python">tutorials/python</a>.</span>
<br /></p>

<p>This tutorial will explain and show you how to access the <strong>Steem</strong> blockchain using the <a href="https://github.com/steemit/steem-python">steem-python</a> library to fetch list of posts and get replies info on selected post.</p>

<h2 id="intro">Intro</h2>

<p>Steem python library has built-in function to get active voters information if post with author and permlink as an argument. Since we don’t have predefined post or author/permlink. We will fetch post list from previous tutorial and give option to choose one post to get its active voters. <code class="highlighter-rouge">get_content_replies</code> function fetches list of replies on content. Note that <code class="highlighter-rouge">get_discussions_by_hot</code> filter is used for fetching 5 posts and after selection of post tutorial uses <code class="highlighter-rouge">author</code> and <code class="highlighter-rouge">permlink</code> of the post to fetch replies.</p>

<h2 id="steps">Steps</h2>

<ol>
  <li><a href="#app-setup"><strong>App setup</strong></a> - Library install and import</li>
  <li><a href="#post-list"><strong>Post list</strong></a> - List of posts to select from created filter</li>
  <li><a href="#replies-list"><strong>Replies list</strong></a> - Get replies list for selected post</li>
  <li><a href="#print-output"><strong>Print output</strong></a> - Print results in output</li>
</ol>

<h4 id="1-app-setup-">1. App setup <a name="app-setup"></a></h4>

<p>In this tutorial we use 3 packages, <code class="highlighter-rouge">pick</code> - helps us to select filter interactively. <code class="highlighter-rouge">steem</code> - steem-python library, interaction with Blockchain. <code class="highlighter-rouge">pprint</code> - print results in better format.</p>

<p>First we import all three library and initialize Steem class</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    <span class="kn">import</span> <span class="nn">pprint</span>
    <span class="kn">from</span> <span class="nn">pick</span> <span class="kn">import</span> <span class="n">pick</span>
    <span class="c1"># initialize Steem class
</span>    <span class="kn">from</span> <span class="nn">steem</span> <span class="kn">import</span> <span class="n">Steem</span>

    <span class="n">s</span> <span class="o">=</span> <span class="n">Steem</span><span class="p">()</span>
</code></pre></div></div>

<h4 id="2-post-list-">2. Post list <a name="post-list"></a></h4>

<p>Next we will fetch and make list of posts and setup <code class="highlighter-rouge">pick</code> properly.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    <span class="n">query</span> <span class="o">=</span> <span class="p">{</span>
        <span class="s">"limit"</span><span class="p">:</span><span class="mi">5</span><span class="p">,</span> <span class="c1">#number of posts
</span>        <span class="s">"tag"</span><span class="p">:</span><span class="s">""</span> <span class="c1">#tag of posts
</span>        <span class="p">}</span>
    <span class="c1">#post list for selected query
</span>    <span class="n">posts</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_hot</span><span class="p">(</span><span class="n">query</span><span class="p">)</span>

    <span class="n">title</span> <span class="o">=</span> <span class="s">'Please choose post: '</span>
    <span class="n">options</span> <span class="o">=</span> <span class="p">[]</span>
    <span class="c1">#posts list options
</span>    <span class="k">for</span> <span class="n">post</span> <span class="ow">in</span> <span class="n">posts</span><span class="p">:</span>
        <span class="n">options</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">post</span><span class="p">[</span><span class="s">"author"</span><span class="p">]</span><span class="o">+</span><span class="s">'/'</span><span class="o">+</span><span class="n">post</span><span class="p">[</span><span class="s">"permlink"</span><span class="p">])</span>
    <span class="c1"># get index and selected filter name
</span>    <span class="n">option</span><span class="p">,</span> <span class="n">index</span> <span class="o">=</span> <span class="n">pick</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">title</span><span class="p">)</span>
</code></pre></div></div>

<p>This will show us list of posts to select in terminal/command prompt. And after selection we will get index and post name to <code class="highlighter-rouge">index</code> and <code class="highlighter-rouge">option</code> variables.</p>

<h4 id="3-replies-list-">3. Replies list <a name="replies-list"></a></h4>

<p>Next we will replies on selected post with <code class="highlighter-rouge">get_content_replies</code>.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  <span class="c1"># get replies for given post
</span>  <span class="n">replies</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">get_content_replies</span><span class="p">(</span><span class="n">posts</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="s">"author"</span><span class="p">],</span><span class="n">posts</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="s">"permlink"</span><span class="p">])</span>
</code></pre></div></div>

<h4 id="4-print-output-">4. Print output <a name="print-output"></a></h4>

<p>Next, we will print result, replies on selected post, selected post details and number of replies.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  <span class="c1"># print post details for selected post
</span>  <span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">replies</span><span class="p">)</span>
  <span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="s">"Selected: "</span><span class="o">+</span><span class="n">option</span><span class="p">)</span>
  <span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="s">"Number of replies: "</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">replies</span><span class="p">)))</span>
</code></pre></div></div>

<p>The example of result returned from the service is a <code class="highlighter-rouge">JSON</code> object with the following properties:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">[{</span><span class="err">'abs_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'active':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">10</span><span class="err">:</span><span class="mi">43</span><span class="err">:</span><span class="mi">36</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'active_votes':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'allow_curation_rewards':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'allow_replies':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'allow_votes':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'author':</span><span class="w"> </span><span class="err">'sarcasms'</span><span class="p">,</span><span class="w">
  </span><span class="err">'author_reputation':</span><span class="w"> </span><span class="mi">1086863019</span><span class="p">,</span><span class="w">
  </span><span class="err">'author_rewards':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'beneficiaries':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'body':</span><span class="w"> </span><span class="err">'follow</span><span class="w"> </span><span class="err">us</span><span class="w"> </span><span class="err">for</span><span class="w"> </span><span class="err">news</span><span class="p">,</span><span class="w"> </span><span class="err">media</span><span class="p">,</span><span class="w"> </span><span class="err">memes</span><span class="p">,</span><span class="w"> </span><span class="err">sports</span><span class="w"> </span><span class="err">updates</span><span class="w"> </span><span class="err">and</span><span class="w"> </span><span class="err">lots</span><span class="w"> </span><span class="err">'</span><span class="w">
          </span><span class="err">'more...'</span><span class="p">,</span><span class="w">
  </span><span class="err">'body_length':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'cashout_time':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-22</span><span class="err">T</span><span class="mi">10</span><span class="err">:</span><span class="mi">43</span><span class="err">:</span><span class="mi">36</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'category':</span><span class="w"> </span><span class="err">'fiction'</span><span class="p">,</span><span class="w">
  </span><span class="err">'children':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'children_abs_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'created':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">10</span><span class="err">:</span><span class="mi">43</span><span class="err">:</span><span class="mi">36</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'curator_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'depth':</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
  </span><span class="err">'id':</span><span class="w"> </span><span class="mi">53110589</span><span class="p">,</span><span class="w">
  </span><span class="err">'json_metadata':</span><span class="w"> </span><span class="err">'</span><span class="p">{</span><span class="nl">"tags"</span><span class="p">:[</span><span class="s2">"fiction"</span><span class="p">],</span><span class="nl">"users"</span><span class="p">:[</span><span class="s2">"sarcasms"</span><span class="p">],</span><span class="nl">"app"</span><span class="p">:</span><span class="s2">"steemit/0.1"</span><span class="p">}</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'last_payout':</span><span class="w"> </span><span class="err">'</span><span class="mi">1970-01-01</span><span class="err">T</span><span class="mi">00</span><span class="err">:</span><span class="mi">00</span><span class="err">:</span><span class="mi">00</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'last_update':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">10</span><span class="err">:</span><span class="mi">43</span><span class="err">:</span><span class="mi">36</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'max_accepted_payout':</span><span class="w"> </span><span class="err">'</span><span class="mf">1000000.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'max_cashout_time':</span><span class="w"> </span><span class="err">'</span><span class="mi">1969-12-31</span><span class="err">T</span><span class="mi">23</span><span class="err">:</span><span class="mi">59</span><span class="err">:</span><span class="mi">59</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'net_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'net_votes':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'parent_author':</span><span class="w"> </span><span class="err">'muratkbesiroglu'</span><span class="p">,</span><span class="w">
  </span><span class="err">'parent_permlink':</span><span class="w"> </span><span class="err">'short-sci-fi-story-the-android-that-sell-meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'pending_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'percent_steem_dollars':</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
  </span><span class="err">'permlink':</span><span class="w"> </span><span class="err">'re-muratkbesiroglu-short-sci-fi-story-the-android-that-sell-meaning</span><span class="mi">-20180615</span><span class="err">t</span><span class="mi">104323737</span><span class="err">z'</span><span class="p">,</span><span class="w">
  </span><span class="err">'promoted':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'reblogged_by':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'replies':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'reward_weight':</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_author':</span><span class="w"> </span><span class="err">'muratkbesiroglu'</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_permlink':</span><span class="w"> </span><span class="err">'short-sci-fi-story-the-android-that-sell-meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_title':</span><span class="w"> </span><span class="err">'Short</span><span class="w"> </span><span class="err">Sci-Fi</span><span class="w"> </span><span class="err">Story:</span><span class="w"> </span><span class="err">The</span><span class="w"> </span><span class="err">Android</span><span class="w"> </span><span class="err">That</span><span class="w"> </span><span class="err">Sell</span><span class="w"> </span><span class="err">Meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'title':</span><span class="w"> </span><span class="err">''</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_pending_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">STEEM'</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_vote_weight':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'url':</span><span class="w"> </span><span class="err">'/fiction/@muratkbesiroglu/short-sci-fi-story-the-android-that-sell-meaning#@sarcasms/re-muratkbesiroglu-short-sci-fi-story-the-android-that-sell-meaning</span><span class="mi">-20180615</span><span class="err">t</span><span class="mi">104323737</span><span class="err">z'</span><span class="p">,</span><span class="w">
  </span><span class="err">'vote_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">},</span><span class="w">
 </span><span class="p">{</span><span class="err">'abs_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'active':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">11</span><span class="err">:</span><span class="mi">26</span><span class="err">:</span><span class="mi">15</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'active_votes':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'allow_curation_rewards':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'allow_replies':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'allow_votes':</span><span class="w"> </span><span class="err">True</span><span class="p">,</span><span class="w">
  </span><span class="err">'author':</span><span class="w"> </span><span class="err">'vicky</span><span class="mi">3585</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'author_reputation':</span><span class="w"> </span><span class="mi">40338001</span><span class="p">,</span><span class="w">
  </span><span class="err">'author_rewards':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'beneficiaries':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'body':</span><span class="w"> </span><span class="err">'lovely</span><span class="w"> </span><span class="err">story</span><span class="w"> </span><span class="err">keep</span><span class="w"> </span><span class="err">it</span><span class="w"> </span><span class="err">up...'</span><span class="p">,</span><span class="w">
  </span><span class="err">'body_length':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'cashout_time':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-22</span><span class="err">T</span><span class="mi">11</span><span class="err">:</span><span class="mi">26</span><span class="err">:</span><span class="mi">15</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'category':</span><span class="w"> </span><span class="err">'fiction'</span><span class="p">,</span><span class="w">
  </span><span class="err">'children':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'children_abs_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'created':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">11</span><span class="err">:</span><span class="mi">26</span><span class="err">:</span><span class="mi">15</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'curator_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'depth':</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
  </span><span class="err">'id':</span><span class="w"> </span><span class="mi">53114015</span><span class="p">,</span><span class="w">
  </span><span class="err">'json_metadata':</span><span class="w"> </span><span class="err">'</span><span class="p">{</span><span class="nl">"tags"</span><span class="p">:[</span><span class="s2">"fiction"</span><span class="p">],</span><span class="nl">"app"</span><span class="p">:</span><span class="s2">"steemit/0.1"</span><span class="p">}</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'last_payout':</span><span class="w"> </span><span class="err">'</span><span class="mi">1970-01-01</span><span class="err">T</span><span class="mi">00</span><span class="err">:</span><span class="mi">00</span><span class="err">:</span><span class="mi">00</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'last_update':</span><span class="w"> </span><span class="err">'</span><span class="mi">2018-06-15</span><span class="err">T</span><span class="mi">11</span><span class="err">:</span><span class="mi">26</span><span class="err">:</span><span class="mi">15</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'max_accepted_payout':</span><span class="w"> </span><span class="err">'</span><span class="mf">1000000.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'max_cashout_time':</span><span class="w"> </span><span class="err">'</span><span class="mi">1969-12-31</span><span class="err">T</span><span class="mi">23</span><span class="err">:</span><span class="mi">59</span><span class="err">:</span><span class="mi">59</span><span class="err">'</span><span class="p">,</span><span class="w">
  </span><span class="err">'net_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'net_votes':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'parent_author':</span><span class="w"> </span><span class="err">'muratkbesiroglu'</span><span class="p">,</span><span class="w">
  </span><span class="err">'parent_permlink':</span><span class="w"> </span><span class="err">'short-sci-fi-story-the-android-that-sell-meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'pending_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'percent_steem_dollars':</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
  </span><span class="err">'permlink':</span><span class="w"> </span><span class="err">'re-muratkbesiroglu-short-sci-fi-story-the-android-that-sell-meaning</span><span class="mi">-20180615</span><span class="err">t</span><span class="mi">112615204</span><span class="err">z'</span><span class="p">,</span><span class="w">
  </span><span class="err">'promoted':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'reblogged_by':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'replies':</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="err">'reward_weight':</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_author':</span><span class="w"> </span><span class="err">'muratkbesiroglu'</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_permlink':</span><span class="w"> </span><span class="err">'short-sci-fi-story-the-android-that-sell-meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'root_title':</span><span class="w"> </span><span class="err">'Short</span><span class="w"> </span><span class="err">Sci-Fi</span><span class="w"> </span><span class="err">Story:</span><span class="w"> </span><span class="err">The</span><span class="w"> </span><span class="err">Android</span><span class="w"> </span><span class="err">That</span><span class="w"> </span><span class="err">Sell</span><span class="w"> </span><span class="err">Meaning'</span><span class="p">,</span><span class="w">
  </span><span class="err">'title':</span><span class="w"> </span><span class="err">''</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">SBD'</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_pending_payout_value':</span><span class="w"> </span><span class="err">'</span><span class="mf">0.000</span><span class="w"> </span><span class="err">STEEM'</span><span class="p">,</span><span class="w">
  </span><span class="err">'total_vote_weight':</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
  </span><span class="err">'url':</span><span class="w"> </span><span class="err">'/fiction/@muratkbesiroglu/short-sci-fi-story-the-android-that-sell-meaning#@vicky</span><span class="mi">3585</span><span class="err">/re-muratkbesiroglu-short-sci-fi-story-the-android-that-sell-meaning</span><span class="mi">-20180615</span><span class="err">t</span><span class="mi">112615204</span><span class="err">z'</span><span class="p">,</span><span class="w">
  </span><span class="err">'vote_rshares':</span><span class="w"> </span><span class="mi">0</span><span class="p">}]</span><span class="w">
</span><span class="err">'Selected:</span><span class="w"> </span><span class="err">muratkbesiroglu/short-sci-fi-story-the-android-that-sell-meaning'</span><span class="w">
</span><span class="err">'Number</span><span class="w"> </span><span class="err">of</span><span class="w"> </span><span class="err">replies:</span><span class="w"> </span><span class="mi">18</span><span class="err">'</span><span class="w">
</span></code></pre></div></div>

<p>From this result you have access to everything associated to the replies including content of reply, author, timestamp, etc., so that you can be use in further development of application with Python.</p>

<p>That’s it!</p>

<h3 id="to-run-the-tutorial">To Run the tutorial</h3>

<ol>
  <li><a href="getting_started.html">review dev requirements</a></li>
  <li><code class="highlighter-rouge">git clone https://gitlab.syncad.com/hive/devportal.git</code></li>
  <li><code class="highlighter-rouge">cd devportal/tutorials/python/07_get_post_comments</code></li>
  <li><code class="highlighter-rouge">pip install -r requirements.txt</code></li>
  <li><code class="highlighter-rouge">python index.py</code></li>
  <li>After a few moments, you should see output in terminal/command prompt screen.</li>
</ol>

<hr />

</section>

</div>
<div class="footer">
  <a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

